import VueRouter from 'vue-router'
import Login from '../pages/Login'
import help from '../pages/help' 	
import image from '../pages/image'
import ShowHistory from '../pages/ShowHistory'
import zhuye from '../pages/zhuye'
import regest from '../pages/regest'
//  创建并暴露router

const originalPush = VueRouter.prototype.push
   VueRouter.prototype.push = function push(location) {
   return originalPush.call(this, location).catch(err => err)
}

export default new VueRouter({
    routes: [
        {
            path: '/',
            redirect: '/login'
        },
        {
            path: '/login', 
            component: Login
        },
        {
            path: '/regest',
            component: regest,
        },
        {
            path: '/zhuye',
            component: zhuye,
            children: [
                {
                    path: 'help', 
                    component: help
                },
                {
                    path: 'upimg', 
                    component: image
                },
                {
                    path: 'his', 
                    component: ShowHistory
                },
            ]
        }
        
    ]

})